package gui.components.map.objects;

import java.awt.Color;
import java.awt.Shape;
import java.awt.geom.AffineTransform;

import combat.protocol.data.PhysicalObject;
import gui.components.map.IobjBasic;

public abstract class objBasic extends PhysicalObject implements IobjBasic {

	private static final long serialVersionUID = 1L;
	protected Color _foregroundcolor = Color.black;
	protected Color _fillcolor = null;
	
	protected double _maxturnangle;
	protected double _turnangle;
	protected double _health;
	
	protected Shape _shape;
	
	protected boolean _haslabel;
	protected boolean _isplayer;
	
	protected objType _type;
	
	protected AffineTransform _at;
	
	
	public objBasic()
	{
		// Create shape
		SetType(objType.Vehicle);
		SetHealth(100);
	}
	
	protected Shape GenerateTransformedShape(Shape _s)
	{
		_at = new AffineTransform();
		_at.rotate(Math.toRadians(getDirection()),_s.getBounds().getCenterX(),_s.getBounds().getCenterY());
		return _at.createTransformedShape(_s);
	}
		
	public void SetHealth(double _h)
	{
		_health = _h;
	}
	
	public double GetHealth()
	{
		return _health;
	}
	
	public void IsPlayer()
	{
		_isplayer = true;
	}
	
	public boolean GetIsPlayer()
	{
		return _isplayer;
	}
	
	public void HasLabel()
	{
		_haslabel = true;
	}
	
	public boolean GetHasLabel()
	{
		return _haslabel;
	}
	
	public void SetType(objType _ot)
	{
		_type = _ot;
	}
	public objType GetType()
	{
		return _type;
	}
	
	public Shape GetShape()
	{
		return _shape;
	}
	
	public void SetShape(Shape _newshape)
	{
		_shape = _newshape;
	}

	public Color GetForegroundColor()
	{
		return _foregroundcolor;
	}
	
	public void SetForegroundColor(Color _newcolor)
	{
		_foregroundcolor = _newcolor;
	}
	
	public Color GetFillColor()
	{
		return _fillcolor;
	}
	
	public void SetFillColor(Color _newcolor)
	{
		_fillcolor = _newcolor;
	}
	
	public double GetMaxTurnAngle()
	{
		return _turnangle;
	}
	
	public void SetMaxTurnAngle(double _newmaxturnangle)
	{
		_maxturnangle = _newmaxturnangle;
	}
	
	public double GetTurnAngle()
	{
		return _turnangle;
	}
	
	public void SetTurnAngle(double _newturnangle)
	{
		_turnangle = _newturnangle;
	}

	public void GenerateShape() {
	}
}